package com.home.controller;

import com.home.base.rest.BaseController;
import com.home.config.InitDataConfig;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.Map;

/**
 * 首页
 *
 * @author chenxf
 * @date 2019-01-03 12:33
 **/
@Controller
@RequestMapping("")
public class HomeController extends BaseController {
    @RequestMapping(value = "/",method = RequestMethod.GET)
    public String rootIndex(Map<String,Object> map){
        return "admin/login";
    }

    @RequestMapping(value = "/login",method = RequestMethod.GET)
    public String login(Map<String,Object> map){
        return "admin/login";
    }

    @RequestMapping(value = "/index",method = RequestMethod.GET)
    public String index(Map<String,Object> map){
        return "admin/index";
    }

    @RequestMapping(value = "config",method = RequestMethod.GET)
    public String config(Map<String,Object> map){
        return "admin/config";
    }

    @RequestMapping(value = "log/list",method = RequestMethod.GET)
    public String log(Map<String,Object> map){
        return "log/list";
    }

    @RequestMapping(value = "user/list",method = RequestMethod.GET)
    public String user(Map<String,Object> map){
        return "user/list";
    }

    @RequestMapping(value = "user/success",method = RequestMethod.GET)
    public String success(Map<String,Object> map){
        return "user/success";
    }

    @RequestMapping(value = "user/edit",method = RequestMethod.GET)
    public String edit(Map<String,Object> map){
        map.put("token", InitDataConfig.getToken());
        map.put("sTime",InitDataConfig.getStartTime());
        map.put("eTime",InitDataConfig.getEndTime());
        map.put("veryCode",InitDataConfig.getVeryCode());
        map.put("price",InitDataConfig.getPrice());
        map.put("num",InitDataConfig.getNum());
        return "user/edit";
    }


}
